﻿using Microsoft.AspNetCore.SignalR;

namespace _26_SignalR
{
    public class MyHub:Hub
    {
     
        /// <summary>
        /// 发送所有连接的客服端
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        public Task sendPublicMessage(string message)
        {
            string connid = this.Context.ConnectionId;
            string msg = $"{connid}{DateTime.Now}:{message}";
            return Clients.All.SendAsync("ReceivePublicMessage",msg);
        }
    }
}
